{template 'common/header'}
<div class="main">
	<ul class="nav nav-tabs">
		{if $turntable == 1}
	    <li><a  href="{php echo $this->createWebUrl('admin');}">管理员管理</a></li>
    	{/if}
	    <li class="active"><a  href="#">添加管理员</a></li>
	</ul>

	<div class="panel panel-default">
		<div class="panel-body">
			<form action="" method="post" class="form" enctype="multipart/form-data">

				<div class="form-group">
					<label for="admin_name" class="control-label"><span style="color: red">*</span>名称:</label>
					<input type="text" class="form-control" name="admin_name" value="">
				</div>
				<div class="form-group">
					<label for="admin_openid" class="control-label" ><span style="color: red">*</span>管理员openid:</label>
					<input type="text" class="form-control" name="admin_openid" value="" required="required">
					<div class="help-block">该openid必须是活动管理里面粉丝管理里面的openid。<span style="color: red">注：添加后将不可以修改。</span></div>
				</div>
				<div class="form-group">
					<label for="admin_mobile" lass="control-label"><span style="color: red">*</span>手机号:</label>
					<input type="number" class="form-control" name="admin_mobile" value="">
				</div>
				<div class="form-group" style="display: block">
					<label class="control-label">打赏/霸屏模版消息推送:</label>
					<label class="radio-inline">
						<input type="radio" name="bpadmin" value="0" class="bpadmin" checked/>都推送
					</label>
					<label class="radio-inline">
						<input type="radio" name="bpadmin" value="1" class="bpadmin"/>霸屏推送
					</label>
					<label class="radio-inline">
						<input type="radio" name="bpadmin" value="2" class="bpadmin"/>打赏推送
					</label>
					<label class="radio-inline">
						<input type="radio" name="bpadmin" value="3" class="bpadmin"/>不推送
					</label>
					<div class="help-block">默认都推送。推送每一笔支付订单详情到管理员微信号。(管理员免支付不通知)</div>
				</div>
				<div class="form-group">

					<label for="free_times" class="control-label">每天免费次数:</label>
					<div class="input-group">
						<input type="number" class="form-control" name="free_times" value="">
						<span class="input-group-addon">次</span>
					</div>
					<div class="help-block">0表示长期免费。默认0.</div>
				</div>
				<div class="form-group">
					<label class="control-label">是否允许免费发红包:</label>
					<label class="radio-inline">
						<input type="radio" name="set_hb" value="0" class="isstartusing" checked/>否
					</label>
					<label class="radio-inline">
						<input type="radio" name="set_hb" value="1" class="isstartusing" />是
					</label>
				</div>
				<div class="form-group">
					<label class="control-label">是否开启:</label>
					<label class="radio-inline">
						<input type="radio" name="status" value="0" class="isstartusing" checked/>是
					</label>
					<label class="radio-inline">
						<input type="radio" name="status" value="1" class="isstartusing" />否
					</label>
				</div>

				<div class="form-group col-sm-12">
					<input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
					<input type="hidden" name="op" value="addadmin" />
				</div>
		</div>
	</div>
	</form>

</div>
<!-- <div id="queding" class="hide">
	<span class="pull-right btn btn-primary" id="chengaddd" onclick="abc()">确定</span>
</div> -->
<script>
	require(['bootstrap'],function($){
		$('.btn').hover(function(){
			$(this).tooltip('show');
		},function(){
			$(this).tooltip('hide');
		});
	});


$(function(){

    $(".check_all").click(function(){
       var checked = $(this).get(0).checked;

       $("input[type=checkbox]").attr("checked",checked);
    });
	$("input[name=deleteall]").click(function(){
		var check = $("input:checked");

		if(check.length<2){
			alert('请选择要删除的记录!');
			return false;
		}
        if( confirm("确认要删除选择的记录?")){
		var id = new Array();
		check.each(function(i){
			id[i] = $(this).val();
		});
		$.post('{php echo $this->createWebUrl('deleteAllcard')}', {idArr:id},function(data){
			if (data.errno ==0)
			{
				location.reload();
			} else {
				alert(data.error);
			}


		},'json');
		}

	});
});
</script>
<script>
function drop_confirm(msg, url){
    if(confirm(msg)){
        window.location = url;
    }
}
</script>
{template 'common/footer'}